﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ChinaGS.Lian.ModuleRemoting;

public partial class recharge_area_confirm_telecom : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SysCommon.checkUserLogin();
        if (!IsPostBack)
        {
            String cusNo = this.Request["telecom_num"];

            TeleComPackage tcp = RemotingClass.teleComBillCheck(cusNo);
            //测试使用           
            /*TeleComPackage tcp = new TeleComPackage();
            tcp.Status = true;//	收发状态	标示该交易是否成功
            tcp.SerialNo = "1234567890";//	交易流水号	缴费时返回
            tcp.Message	= "success";//返回消息	根据状态码不同为不同消息
            tcp.StatusNo	 = "00";//状态码	见状态码定义
            tcp.AccpetType	 = "1";//受理类型
            tcp.AccpetTypeCN = "后付费";//	受累类型中文
            tcp.ItemNo = "123456789";//	合同号
            tcp.CusNo	 = cusNo;//客户号码
            tcp.CusName = "DenverYee";//客户名称
            tcp.Charge =0;//账户余额
            tcp.RealPay = 0;//实收金额
            tcp.ReceiPay	= 0;//应收金额
            tcp.PayDate = DateTime.Now.ToString("yyyy年MM月dd日");//付款日期
            tcp.isDeaulting = false;//是否欠费 */

            if(tcp.Status){
                if (!tcp.StatusNo.Equals("00"))
                {
                    //测试使用
                    this.LabMessage.Text = tcp.Message;
                    //调整内容正式时使用
                    //this.LabMessage.Text = RemotingClass.showErrorMessage(tcp.StatusNo);                        
                    PanBill.Visible = false;
                }
                else
                {
                    this.LabMessage.Text = "尊敬的" + tcp.CusName + "，您是" + tcp.AccpetTypeCN + "用户，您的账单信息如下：";

                    LabCusNo.Text = tcp.CusNo;
                    LabCusName.Text = tcp.CusName;
                    LabAccpetTypeCN.Text = tcp.AccpetTypeCN;
                    if (tcp.AccpetType.Equals("1"))//后付费
                    {
                        //显示查询结果     
                        this.LabChargeName.Text = "本期账单";
                        this.LabCharge.Text = tcp.ReceiPay.ToString();
                    }
                    else
                    { //预付费2,3

                        //显示查询结果            
                        this.LabChargeName.Text = "账户余额";
                        this.LabCharge.Text = tcp.Charge.ToString();
                    }

                    HidAccpetType.Value = tcp.AccpetType;
                    HidCharge.Value = tcp.Charge.ToString();
                    HidReceiPay.Value = tcp.ReceiPay.ToString();
                    HidAcctId.Value = tcp.ItemNo;//合同号
                    HidcusNo.Value = cusNo;

                    PanBill.Visible = true;
                }               
            }else{
                this.LabMessage.Text = "本次操作失败，错误信息是：" + tcp.Message + "请稍后重试！";
                //显示查询失败
                PanBill.Visible = false;
            }
        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("fill_telecom.aspx?HidAccpetType=" + HidAccpetType.Value
                                   + "&HidCharge=" + HidCharge.Value.ToString()
                                   + "&HidReceiPay=" + HidReceiPay.Value.ToString()
                                   + "&HidAcctId=" + HidAcctId.Value
                                   + "&HidcusNo=" + HidcusNo.Value);
    }
}
